# -*- coding: utf-8 -*
import os

import requests
import sys


class Youtube:
    def __init__(self):
        self.url = 'http://www.youtube.com'

    def run(self):
        _path = os.path.join(os.path.abspath('.'), '../')
        sys.path.append(_path)
        _ei = __import__('Utils.C002_extract_info', fromlist=['C002_extract_info'])
        _ua_file = {'pc': '{0}Utils/{1}'.format(_path, _ei.ExtractInfo.ua_file['pc'])}
        _user_agent = _ei.ExtractInfo.get_useragent(file=_ua_file)
        try:
            _response = requests.get(self.url, headers=_user_agent, timeout=3)
        except Exception as e:
            print(e)


def main():
    ytb = Youtube()
    ytb.run()


if __name__ == '__main__':
    main()
